<TITLE>Workflow.NET
	Script1
	-References</TITLE>
<STYLE>.toolbartable
{
	background: #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolbartext
{
	font-size: 12px;
	font-family: Verdana,Tahoma;
	font-weight:bolder;
	color: Black;
}
.toolbarselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.toolbarbutton
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #cccccc;
    color:Black;
    border-color:Silver;
}
.toolbartitleheading
{
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
	text-align:right;
}
.toolbartitle
{
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
	text-align:right;
	font-weight:bolder;
}


.toolboxtable
{
	background:  #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolboxinternaltable
{
	background:  #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolboxheading
{
	background: black;
	font-size: 12px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
}
.toolboxcolumn
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR:  #889CD5;
    color:white;
    border-color:White;	
    border-top: 1px ridge #C6B36C;
	border-right: 1px ridge #413400;
	border-bottom: 1px ridge #413400;
	border-left: 1px ridge #C6B36C;
}
.toolboxbuttons
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #889CD5;
    color:white;   
    border-color:White;
}
.toolboxparent
{
	background:  #C4D2FB;
	font-size: 11px;
	font-family: Verdana, Tahoma;
	color: black;
	font-weight:bolder;
	text-align:center;
}
.toolboxparentbevell
{
	background:  #889CD5;
	font-size: 11px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
	border-top: 1px ridge #C6B36C;
	border-right: 1px ridge #413400;
	border-bottom: 1px ridge #413400;
	border-left: 1px ridge #C6B36C;
}


.imagetable
{
	background: #C4D2FB;
}
.imageiframe
{
	background: #FFFF66;
}



.propertiesboxtable
{
	background: #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxheading
{
	background: Black;
	font-size: 12px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
}
.propertiesboxactionselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.propertiesboxbuttons
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #cccccc;
    color:black;
    border-color:silver;	
}
.propertiesboxpropertytable
{
	background: Silver;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;	
}
.propertiesboxpropertyextraspace
{
	background:  #C4D2FB;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxpropertybuttonstable
{
	background:  #C4D2FB;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxinput
{
	FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
}
.propertiesboxselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.propertiesboxpropertytitle
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
	background: #C4D2FB;
}
.propertiesboxinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 0px #737373 solid;
	text-decoration: none;
}
.propertiesboxinputstable
{
	background: White;
	font-size: 11px;
	font-family: Verdana,Tahoma;
	color: Black;	
}
.propertiesboxinputbutton
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #889CD5;
    color:White;
    border-color:White;	
}



TD
{
    FONT-SIZE: 10px;
    FONT-FAMILY: Verdana,Tahoma
}
A
{
    COLOR: navy
}
.linkinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid;
    width: 200px
}
.returninputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid;
    width: 150px
}
.inputs
{
    FONT-SIZE: 12px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid
}
.lockedinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #DBEAF5;
}
.buttons
{
    FONT-SIZE: 11px;
        FONT-FAMILY: Verdana,Tahoma;
        BACKGROUND-COLOR: #cccccc;
        color:black;
    border-color:silver;
}
.pageheader
{
    FONT-WEIGHT: bold;
    FONT-SIZE: 12px;
    FONT-FAMILY: Verdana,Tahoma
}
.properties
{
    FONT-SIZE: 11px;
    COLOR: maroon;
    FONT-FAMILY: Verdana,Tahoma
}
.list
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Tahoma
}
.propertyselected
{
    BACKGROUND-COLOR: midnightblue
}
.propertytableinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 1px solid white;
	text-decoration: none
}
.propertypage
{
	background-color : #93BEE2;
}
.controlbg
{
	background-color : #93BEE2;
}
.gridtableinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 1px solid white;
}
.gridanchor
{
    FONT-SIZE: 10px;
    FONT-FAMILY: Verdana,Tahoma;
	text-decoration:none;
}</STYLE>
<BODY marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" width="300">
	<form name="wf_theform">
		<TABLE width="100%" height="333" bgcolor="White" cellspacing="0" cellpadding="0" ID="Table1">
			<TR>
				<TD valign="top" height="243">
					<TABLE>
						<TR>
							<TD>
								<B>
									Script1
									-</B>References
							</TD>
						</TR>
						<TR>
							<TD>
								<input name="wf_addrow" type="button" class="buttons" onclick="addnewrow();" value="New row">
								<input name="wf_removerow" type="button" class="buttons" onclick="removeselected();" value="Remove selected">
							</TD>
						</TR>
						<TR>
							<!--<TD height="180" valign="top" width="460">-->
							<TD>
								<div id="divgrid" style="top:40">&nbsp;</div>
							</TD>
						</TR>
						<TR>
							<TD>
								<p align="right">
								<input name="wf_GenRegExp" type="button" class="buttons" onclick="divGenRE.style.visibility='visible'" value="Generate RegExp for Selected Row">
								<p align="right">
								&nbsp;</TD>
						</TR>						
					</TABLE>
					<TABLE width="482">
						<TR>
							<td align="left" height="26" width="482">
							<div id="divGenRE" style="bgcolor:blue;top:40; visibility: hidden; width:613; height:33">
							 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							 Start String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; End<br>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<input class="propertiesboxinput" type=text name="StartString" size="27">&nbsp; 
                             Delimiter&nbsp; 
                            <input class="propertiesboxinput" type=text name="DLimiterStart" size="4">&nbsp;&nbsp;&nbsp; 
                            <input class="propertiesboxinput" type=text name="DLimiterEnd" size="4">
									<INPUT id="button1" class="buttons" type="button" value="Generate" name="GenREOK" onclick="GenerateRegExp()">
									<INPUT id="button2" class="buttons" type="button" value="Hide" name="GenREClose" onclick="divGenRE.style.visibility='hidden'">&nbsp;&nbsp;
							</div>
							</td>
						</TR>
					</TABLE>
					&nbsp;<p>
					<BR>
				</TD>
			</TR>
			<TR>
				<TD height="7" bgcolor="black"><IMG src="?drawimage=spacer.gif" height="1"></TD>
			</TR>
			<TR>
				<TD height="6" bgcolor="white"><IMG src="?drawimage=spacer.gif" height="1"></TD>
			</TR>
			<TR>
				<TD align="right" height="18">
					<p align="left"><font color="#0000FF">Specify * in search criteria 
                    to retrieve all.</font>
				</TD>
			</TR>
			<TR>
				<TD align="right" height="43">
					<input type="button" class="buttons" value="Update" style="width:65" name="btnok" onclick="submitform();" ID="Button1">
					<input type="button" class="buttons" value="Cancel" style="width:65" ID="btnCancel" onclick="window.close();" NAME="btnCancel">
				</TD>
			</TR>
		</TABLE>
	</form>
</BODY>
<SCRIPT>
	//variable declaration for scroll
	var obj;
	var height=255;
	var imgtop=40;
	var visiblewidth = 460 + 20;
	var visible=180;
	var visibletop=0;
	var slidespeed =10;
	var visibleheight=180;
	var stopslidingup=false;
	var stopslidingdn=false;
	//*************************************	

	var errstr="";
	var rowempty=false;
	var cols= new Array(0);
	var rows= new Array(0);
	var CustomControls = new Array();	
	var gridwidth = 460;
	
	AddColumn('Variable',200,"select","<%#assignvarNcontents%>",true,'','','');
	AddColumn('Search criteria (regular expression)',200,null,null,true,'','','');	
	AddColumn('Search in',100,"select","Entire Email:All,FromAddress:FromAddress,ToAddress:ToAddress,Subject:Subject,Body:Body,Attachments:Attachments,Attached File Names:AttachFileNms",false,'100','','Body');
	AddColumn('Set variable in the named group',100,null,null,false,'','','');

	<%#addrow%>

	
	DrawGrid();


	function findObj(n, d) 
	{ 
		var p,i,x;  
		if(!d) d=document; 
		if((p=n.indexOf("?"))>0&&parent.frames.length) 
		{
			d=parent.frames[n.substring(p+1)].document; 
			n=n.substring(0,p);
		}
		if(!(x=d[n])&&d.all) x=d.all[n]; 
		for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); 
		return x;
	}

	
	function GetControlText(ControlName, ControlType, Width, TabIndex, Values,defaultvalue)
	{
		var controltext="";
		var valuearray;
		var i;

		var widthstr;
		
		if(Width > 0)
			widthstr = "width: "+Width;
		else
			widthstr = "";
		
		switch(ControlType)
		{
			case "select":		
				controltext = "<SELECT name=\""+ControlName+"\" class=gridtableinputs style='"+widthstr+"' TABINDEX='"+TabIndex+"'>";
				var selectvalues=Values.split(",");
	
				for(i=0;i<selectvalues.length;i++)
				{					
					valuearray = selectvalues[i].split(":");					
					if (defaultvalue == valuearray[1])
						controltext	+= "<OPTION value=\"" + valuearray[1] + "\" selected>" + valuearray[0] + "</OPTION>";
					else
						controltext	+= "<OPTION value=\"" + valuearray[1] + "\">" + valuearray[0] + "</OPTION>";
				}
				controltext += "</SELECT>";
				break;
			default:
				controltext ="<input name=\""+ControlName+"\" class=gridtableinputs type=textbox style='"+widthstr+"' TABINDEX='"+TabIndex+"' value='"+ defaultvalue+"'>";
				break;
				
		}

		return controltext;
	}

	function getcustomcontrolindex(controlname)
	{
		var returnvalue=-1;
		var i=0;
		for(i=0;i<CustomControls.length;i++)
		{
			if (CustomControls[i].name == controlname)
				returnvalue = i;
		}
		return returnvalue;
	}

	function row()
	{
		this.selected =false;
		this.cols = new Array(cols.length);
	}

	function col()
	{
		this.titlestring = "";
		this.width=0; //Max width of the field
		this.type="";
		this.values="";
		this.mandatory=false;
		this.displaywidth=""; //Display width for the column (to be specified with the TD tag)
		this.validationtype="";
	}

	function AddColumn(titlestring,width,type,values,mandatory,displaywidth,validationtype,defaultvalue)
	{
		var arrayindex = 0;
		arrayindex  = cols.length;
		cols[arrayindex] = new col();
		cols[arrayindex].titlestring = titlestring;
		
		//if( parseInt(width) >= 100 )
		//	cols[arrayindex].width = 0;
		//else
		//	cols[arrayindex].width = (parseInt(gridwidth)) * parseInt(width) / 100;
		
		cols[arrayindex].width = parseInt(width);	
		cols[arrayindex].displaywidth = displaywidth;
		cols[arrayindex].mandatory = mandatory;
		cols[arrayindex].validationtype = validationtype;
		cols[arrayindex].defaultvalue = defaultvalue;	
		if( type != null )
		{
			if( type == "select" )
			{
				cols[arrayindex].type = type;
				cols[arrayindex].values=values;				
			}
		
		}
	}

	function AddRow()
	{
		var newarrayid = rows.length;
		rows[newarrayid] = new row();
		for (i=0;i<cols.length;i++)
		{
			if((arguments.length-1) >= i)
			{
				rows[newarrayid].cols[i] = arguments[i];	
			}
			else
			{
				rows[newarrayid].cols[i] = "";	
			}
		}
	}

	function DrawGrid()
	{
		
		if(navigator.userAgent.indexOf("Netscape") >0 )
				document.all = document.getElementsByTagName("*");
		
		var obj = document.all["divgrid"];
		var controltext ="";
		var customcontrolindex;

		var innerhtml="";
		var colwidth=0;
		//innerhtml = "<TABLE width=460 bgcolor=#808080 cellspacing=1>";
		innerhtml = "<TABLE width=<%#gridwidth%> bgcolor=#808080 cellspacing=1>";
		
		innerhtml += "<TR bgcolor=#d4d0c8>";
		innerhtml += "<TD bgcolor=#d4d0c8 width=15>&nbsp;</TD>";

		for (i = 0;i<cols.length;i++)
		{
			innerhtml += "<TD width='"+cols[i].displaywidth+"'>";
			innerhtml += cols[i].titlestring;
			innerhtml +="</TD>";
		}
		innerhtml +="</TR>";
		for (i = 0;i<rows.length;i++)
		{
			innerhtml +="<TR bgcolor=white>";
			innerhtml += "<TD bgcolor=#d4d0c8 width=15>&nbsp;</TD>";
			for(j=0;j<cols.length;j++)
			{
				innerhtml += "<TD height=15 >";
				innerhtml += "<div id='row" + i +"col" + j +"'>" + GetDisplayString(i,j,rows[i].cols[j]) + "</div>";
				innerhtml += "</TD>";
			}
			innerhtml +="</TR>";
		}

		innerhtml += "<TR bgcolor=white>";
		innerhtml += "<TD bgcolor=#d4d0c8 width=15>&nbsp;</TD>";
		for (i = 0;i<cols.length;i++)
		{
			colwidth = cols[i].width;
			if (parseInt(colwidth) ==0)
				colwidth = parseInt(gridwidth) / (cols.length + 1);
			
			innerhtml += "<TD>";
			
			controltext=GetControlText("wf_gridinput" + i , cols[i].type, cols[i].width, i+1, cols[i].values,cols[i].defaultvalue);
			//alert("wf_gridinput" + i);
			innerhtml += controltext;			
			innerhtml +="</TD>";
		}
		innerhtml +="</TR>";
		innerhtml +="</TABLE>";		
		obj.innerHTML = innerhtml;
		height = (rows.length * 15) + 60;
		//alert(innerhtml);
		window.setTimeout('findObj("wf_gridinput0").focus();',250);		
	}
		
	function GetDisplayString(rowid,colid,string)
	{
		var colwidth = cols[colid].width;
		var displaystring =string;
		/*if (parseInt(colwidth) ==0)
			colwidth = parseInt(gridwidth) / (cols.length + 1);
		
		var returnvalue="";
		colwidth = parseInt(colwidth/7)-1;
		if (string.length > colwidth )		
		{
			displaystring = displaystring.substring(0,colwidth) + "...";
		}*/
		
		if (string.length > 0)
			returnvalue = "<A title='" + string + "' class=gridanchor href='javascript:selectrow("+ rowid +")'>" + displaystring + "</A>";
		else
			returnvalue = "&nbsp;";			
		return returnvalue;
	}
	
	function addnewrow()
	{
		if( !checkandaddvalues() )
		{
			DrawGrid();
		}
		else
		{
			alert(errstr);
			window.setTimeout('findObj("wf_gridinput0").focus();',250);
		}
				
	}
	
	function removeselected()
	{
		var temprows=new Array();
		var arrayindex = 0;
		for (i=0;i<rows.length;i++)
		{
			if (! rows[i].selected)
			{
				temprows[temprows.length] = rows[i];
			}
		}
		rows = temprows;
		DrawGrid();
	}

	function checkandaddvalues()
	{
		var temprow = new row();
		var flag = false;
		var err=false;

		errstr="";		
		if(navigator.userAgent.indexOf("Netscape") >0 )
			document.all = document.getElementsByTagName("*");

		var obj;
		for (i=0;i<cols.length;i++)
		{
			obj = document.all["wf_gridinput" + i];
			//alert(cols[i].validationtype)
			if (obj.value.length > 0 )
			{
				 if(i!=0 && i!=2)
				 {
					flag=true;
					if( cols[i].validationtype.length > 0 && cols[i].validationtype == "timespan")
					{
						var toMatchstr = obj.value
						if (toMatchstr.indexOf(".") < 0 )
							toMatchstr += ".00:00:00"
						
						var timeSpanPat = /^\d*\.[0-2]{1}[0-3]{1}\:[0-5]{1}[0-9]{1}\:[0-5]{1}[0-9]{1}/;
						var timeSpanPat1 = /^\d*\.[0-1]{1}[0-9]{1}\:[0-5]{1}[0-9]{1}\:[0-5]{1}[0-9]{1}/;
						var matchArray = toMatchstr.match(timeSpanPat);
						var matchArray1 = toMatchstr.match(timeSpanPat1);
						if(matchArray == null && matchArray1 == null)
						{
							err=true;
							errstr += "Not a valid Time Span (dd.hh:mm:ss) Value "+ cols[i].titlestring +"\r\n";
						}	
				 }					 
					}				   
				}	
			else
			
				if( cols[i].mandatory)
				{
					err=true;
					errstr += "Please specify value for "+cols[i].titlestring+"\r\n";
				}
				
				
				
			temprow.cols[i] = obj.value;
		}
		if (flag && !err)
			rows[rows.length] = temprow;
		
		//if(rows.length == 0 && !flag)
		//	flag = false;
		
		rowempty = !flag;
		return (err);
			
	}
	
	function selectrow(rowid)
	{
		var obj
		for (i=0;i<cols.length;i++)
		{
			obj = document.all["row"+rowid + "col" + i];
			if (rows[rowid].selected)
				obj.style.backgroundColor = "white";
			else
				obj.style.backgroundColor = "#DBEAF5";	
		}
		rows[rowid].selected  = !rows[rowid].selected;
	}

	function getgridvalues()
	{
		var returnstring="";
		var returnsubstring = "";
			
		returnstring += ConvertToString(rows.length,4);	
		for (i=0;i<rows.length;i++)
		{
			returnsubstring = "";
			returnsubstring += ConvertToString(cols.length,4);	
			for (j=0;j<cols.length;j++)
			{
				returnsubstring += "$" + ConvertToString(rows[i].cols[j].length,4)+rows[i].cols[j] ;
			}
			
			returnsubstring = ConvertToString( returnsubstring.length, 4 )+returnsubstring;
			returnstring +="#" + returnsubstring;
		}
		
	
		return returnstring;
	}

	function ConvertToString(  number,  width )
	{
		var str="";
		var i;
		
		str=number.toString();
		var l = str.length;
		for(i=0;i<(width-l);i++)
		{
			str = "0" + str;
		}	
		return str.substring(0,width);
	}
	
				

	function GenerateRegExp()
	{

		var DLimStart=document.getElementsByTagName("input")["DLimiterStart"].value;
		var DLimEnd=document.getElementsByTagName("input")["DLimiterEnd"].value;
		var DLimStartOrg=DLimStart;
		if (DLimStart.indexOf("[")>=0)
		{
		  DLimStart=DLimStart.replace("[","\\[");
		}
		if (DLimStart.indexOf("]")>=0)
		{
		  DLimStart=DLimStart.replace("]","\\]");
		}
		if (DLimStart.indexOf("(")>=0)
		{
		  DLimStart=DLimStart.replace("(","\\(");
		}
		if (DLimStart.indexOf(")")>=0)
		{
		  DLimStart=DLimStart.replace(")","\\)");
		}
		
		if (DLimEnd.indexOf("[")>=0)
		{
		  DLimEnd=DLimEnd.replace("[","\\[");
		}
		if (DLimEnd.indexOf("]")>=0)
		{
		  DLimEnd=DLimEnd.replace("]","\\]");
		}
		if (DLimEnd.indexOf("(")>=0)
		{
		  DLimEnd=DLimEnd.replace("(","\\(");
		}
		if (DLimEnd.indexOf(")")>=0)
		{
		  DLimEnd=DLimEnd.replace(")","\\)");
		}

	
		sGenRegExp=document.getElementsByTagName("input")["StartString"].value;
		sGenRegExp=sGenRegExp+"[^"+DLimStartOrg+"]*"

		var ElmntRegExp;
		var ElmntNmdGrp;
		for(i=0;i< document.forms[0].elements.length-1;i++)
		{			
			//alert(document.forms[0].elements[i].name + ": wf_gridinput1");
			if (document.forms[0].elements[i].name=="wf_gridinput1")
			{
				ElmntRegExp=i;
			}
			if (document.forms[0].elements[i].name=="wf_gridinput3")
				ElmntNmdGrp=i;	

		}
		
		if (document.forms[0].elements[ElmntNmdGrp].value!=null)
			if (document.forms[0].elements[ElmntNmdGrp].value!="")								
				sGenRegExp=sGenRegExp+DLimStart+"(?'"+document.forms[0].elements[ElmntNmdGrp].value+"'[^"+DLimStartOrg+"]*)"+DLimEnd ;
			else
				{
					sGenRegExp=sGenRegExp+DLimStart+"(?'"+"Content"+"'[^"+DLimStartOrg+"]*)"+DLimEnd ;
					document.forms[0].elements[ElmntNmdGrp].value="Content";
				}
		else
			{
				sGenRegExp=sGenRegExp+DLimStart+"(?'"+"Content"+"'[^"+DLimStartOrg+"]*)"+DLimEnd ;
				document.forms[0].elements[ElmntNmdGrp].value="Content";
			}

		//alert(window.opener.document.frmSubmit.propertyvalue.value);
		//alert(sGenRegExp);
		//sGenRegExp=sGenRegExp.replace(/([^\\])'/g, "$1\\\\\\'");
		document.forms[0].elements[ElmntRegExp].value=sGenRegExp;


		//window.opener.document.frmSubmit.propertyvalue.value="Test";
/*		for(i=0;i< document.forms[0].elements.length-1;i++)
		{			
			//alert(document.forms[0].elements[i].name + ": wf_gridinput1");
			if (document.forms[0].elements[i].name=="wf_gridinput1")
			{
				//alert(true);
				document.forms[0].elements[i].value=sGenRegExp;
			}
			if (document.forms[0].elements[i].name=="wf_gridinput3")
				

		}
*/		//wf_gridinput1.value=sGenRegExp;
		divGenRE.style.visibility='hidden';


	}


	function submitform()
	{
		var err=checkandaddvalues();
		if( (rowempty) || (!rowempty && !err) )
		{
			var sSubmit=getgridvalues();			
			window.opener.properties("_hidtempstore",getgridvalues());
			//window.opener.submitform("?mode=edit&propertypage=grid&propertyname=References&WorkflowID=ProcessDesigner1&WorkflowSelectAction=Script1&&filename=Default&category=Engine Actions");
			window.opener.submitform("?mode=edit&<%#qspropertypagename%>=<%#propertypage%>&<%#qspropertyname%>=<%#propertyname%>&<%#SelectedItemQueryString%>");
			window.close();
		}
		else
		{
			alert(errstr);
			window.setTimeout('findObj("wf_gridinput0").focus();',250);		
		}
	}



    </SCRIPT>